package com.baidu.structure.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.baidu.structure.R;
import com.baidu.structure.constants.Tags;
import com.hyphenate.easeui.EaseConstant;
import com.hyphenate.easeui.ui.EaseBaseFragment;
import com.hyphenate.easeui.ui.EaseChatFragment;

public class ChatActivity extends AppCompatActivity {
    private EaseChatFragment chatFragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chat);
        init();
    }

    private void init() {
        chatFragment = new EaseChatFragment();
        int chatType = getIntent().getIntExtra(EaseConstant.EXTRA_CHAT_TYPE, EaseConstant.CHATTYPE_SINGLE);
        String userId = getIntent().getStringExtra(EaseConstant.EXTRA_USER_ID);
        Bundle args = new Bundle();
        args.putInt(EaseConstant.EXTRA_CHAT_TYPE, chatType);
        args.putString(EaseConstant.EXTRA_USER_ID, userId);
        chatFragment.setArguments(args);
        getSupportFragmentManager().beginTransaction().add(R.id.chatContainer, chatFragment, Tags.FRAGEMNT_CHAT).commit();
    }

    @Override
    protected void onResume() {
        super.onResume();
//        chatFragment.hideTitleBar();
    }
}
